/* -*- C++ -*- */
/*===========================================================
 
 .---=||||[ B L O O D Y ]|||||=====================----------....
 |                                                              |
 |    THE  M O S T   B L O O D Y  GAME EVER!                    |
 |                                                              |
 |    bloody harvest is coming... soon,                         |
 |                                              heil Satan!     |
 !                                                              !
 .                                                              ,
  ~~~~-------------================================|||||||||==-~




 Name-Space: {core, logic, editor}
 Module: {draw, coll, scgr, ...}
 Class: <name of class>
 Last modification:  <author>, <time>

 TODO:
 <-------- todo #1 ---------->
 <-------- todo #2 ---------->
 <-------- todo #3 ---------->
        ............
 <-------- todo #n ---------->

 FIX:
 <-------- fix #1 ----------->
 <-------- fix #1 ----------->
         ..........
 <-------- fix #n ----------->




 
 
 ============================================================*/
#ifndef __evnt_EventControl_Header_File__
#define __evnt_EventControl_Header_File__

#include "common.h"
#include "core/evnt/Mouse.h"
#include "core/evnt/Keyboard.h"

namespace core
{
	namespace evnt
	{


		/**
		 * Controler of Input Device events.
		 * 
		 */
		class EventControl
		{
		public:
			/// Proceses events
			void processEvent();
			
			/// Get keyboard controller object
			const Keyboard& getKeyboard()const { return *keyboard; }
			
			/// Get mouse controller object
			Mouse& getMouse()  { return *mouse; }

			/// Is end requested
			bool isEndRequested(){ return shouldEnd; }


			/// Get singleton instance
			static EventControl& instance();

			/// Frees singleton
			static void free();

		private:
			Keyboard* keyboard;
			Mouse* mouse;
			bool shouldEnd;


			static EventControl* inst;

			EventControl();
			virtual ~EventControl();
		};
	
	}
}

#endif //__evnt_EventControl_Header_File__

